<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"	
	template="/resources/scaffold/pageTemplate.xhtml">

	<f:metadata>
		<f:viewParam name="id" value="#{bankBean.id}"/>
		<f:event type="preRenderView" listener="#{bankBean.retrieve}"/>
	</f:metadata>

	<ui:param name="pageTitle" value="Create Bank"/>

	<ui:define name="header">
		Bank
	</ui:define>

	<ui:define name="subheader">
		<c:choose>
			<c:when test="#{!empty bankBean.id}">
				Edit existing Bank
			</c:when>
			<c:otherwise>
				Create a new Bank
			</c:otherwise>
		</c:choose>
	</ui:define>

	<ui:define name="footer"/>

	<ui:define name="main">
		<h:form id="create">
			<h:messages globalOnly="true" styleClass="error"/>

			<h:panelGrid columnClasses="label,component,required" columns="3">
				<h:outputLabel for="bankBeanBankAddress" value="Address:"/>
				<h:panelGroup>
					<h:selectOneMenu converter="#{addressBean.converter}" id="bankBeanBankAddress" value="#{bankBean.bank.address}">
						<f:selectItem/>
						<f:selectItems value="#{addressBean.all}"/>
					</h:selectOneMenu>
					<h:message for="bankBeanBankAddress" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="bankBeanBankUserByModifiedBy" value="User By Modified By:"/>
				<h:panelGroup>
					<h:selectOneMenu converter="#{userBean.converter}" id="bankBeanBankUserByModifiedBy" value="#{bankBean.bank.userByModifiedBy}">
						<f:selectItem/>
						<f:selectItems value="#{userBean.all}"/>
					</h:selectOneMenu>
					<h:message for="bankBeanBankUserByModifiedBy" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="bankBeanBankUserByCreatedBy" value="User By Created By:"/>
				<h:panelGroup>
					<h:selectOneMenu converter="#{userBean.converter}" id="bankBeanBankUserByCreatedBy" value="#{bankBean.bank.userByCreatedBy}">
						<f:selectItem/>
						<f:selectItems value="#{userBean.all}"/>
					</h:selectOneMenu>
					<h:message for="bankBeanBankUserByCreatedBy" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="bankBeanBankCustomer" value="Customer:"/>
				<h:panelGroup>
					<h:selectOneMenu converter="#{customerBean.converter}" id="bankBeanBankCustomer" value="#{bankBean.bank.customer}">
						<f:selectItem/>
						<f:selectItems value="#{customerBean.all}"/>
					</h:selectOneMenu>
					<h:message for="bankBeanBankCustomer" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="bankBeanBankName" value="Name:"/>
				<h:panelGroup>
					<h:inputText id="bankBeanBankName" maxLength="65535" required="true" value="#{bankBean.bank.name}"/>
					<h:message for="bankBeanBankName" styleClass="error"/>
				</h:panelGroup>
				<h:outputText value="*"/>
				<h:outputLabel for="bankBeanBankAccountNumber" value="Account Number:"/>
				<h:panelGroup>
					<h:inputText id="bankBeanBankAccountNumber" required="true" value="#{bankBean.bank.accountNumber}"/>
					<h:message for="bankBeanBankAccountNumber" styleClass="error"/>
				</h:panelGroup>
				<h:outputText value="*"/>
				<h:outputLabel for="bankBeanBankSwiftcode" value="Swiftcode:"/>
				<h:panelGroup>
					<h:inputText id="bankBeanBankSwiftcode" maxLength="65535" value="#{bankBean.bank.swiftcode}"/>
					<h:message for="bankBeanBankSwiftcode" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="bankBeanBankIfsc" value="Ifsc:"/>
				<h:panelGroup>
					<h:inputText id="bankBeanBankIfsc" maxLength="65535" value="#{bankBean.bank.ifsc}"/>
					<h:message for="bankBeanBankIfsc" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="bankBeanBankCreatedOn" value="Created On:"/>
				<h:panelGroup>
					<h:inputText id="bankBeanBankCreatedOn" maxLength="10" value="#{bankBean.bank.createdOn}">
						<f:convertDateTime type="date"/>
					</h:inputText>
					<h:message for="bankBeanBankCreatedOn" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="bankBeanBankModifiedOn" value="Modified On:"/>
				<h:panelGroup>
					<h:inputText id="bankBeanBankModifiedOn" value="#{bankBean.bank.modifiedOn}"/>
					<h:message for="bankBeanBankModifiedOn" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="bankBeanBankBranch" value="Branch:"/>
				<h:panelGroup>
					<h:inputText id="bankBeanBankBranch" maxLength="65535" required="true" value="#{bankBean.bank.branch}"/>
					<h:message for="bankBeanBankBranch" styleClass="error"/>
				</h:panelGroup>
				<h:outputText value="*"/>
				<h:outputLabel for="bankBeanBankBeneficiaryName" value="Beneficiary Name:"/>
				<h:panelGroup>
					<h:inputText id="bankBeanBankBeneficiaryName" maxLength="65535" required="true" value="#{bankBean.bank.beneficiaryName}"/>
					<h:message for="bankBeanBankBeneficiaryName" styleClass="error"/>
				</h:panelGroup>
				<h:outputText value="*"/>
				<h:outputLabel for="bankBeanBankTableId" value="Table Id:"/>
				<h:panelGroup>
					<h:inputText id="bankBeanBankTableId" required="true" value="#{bankBean.bank.tableId}"/>
					<h:message for="bankBeanBankTableId" styleClass="error"/>
				</h:panelGroup>
				<h:outputText value="*"/>
				<h:outputLabel for="bankBeanBankIsPublic" value="Is Public:"/>
				<h:panelGroup>
					<h:selectBooleanCheckbox id="bankBeanBankIsPublic" value="#{bankBean.bank.isPublic}"/>
					<h:message for="bankBeanBankIsPublic" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="bankBeanBankIsDeleted" value="Is Deleted:"/>
				<h:panelGroup>
					<h:selectBooleanCheckbox id="bankBeanBankIsDeleted" value="#{bankBean.bank.isDeleted}"/>
					<h:message for="bankBeanBankIsDeleted" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
			</h:panelGrid>

			<div class="buttons">
				<h:commandLink value="Save" action="#{bankBean.update}" styleClass="btn btn-primary"/>
				<c:choose>
					<c:when test="#{!empty bankBean.id}">
						<h:link value="Cancel" outcome="view" styleClass="btn btn-primary">
							<f:param name="id" value="#{bankBean.id}"/>
						</h:link>
						<h:commandLink value="Delete" action="#{bankBean.delete}" styleClass="btn btn-primary"/>
					</c:when>
					<c:otherwise>
						<h:link value="Cancel" outcome="search" styleClass="btn btn-primary"/>
					</c:otherwise>
				</c:choose>
			</div>
		</h:form>
	</ui:define>

</ui:composition>